package com.bfxy.rabbit.producer.autoconfigure;

import com.bfxy.rabbit.producer.broker.ProducerClient;
import com.bfxy.rabbit.producer.broker.RabbitBroker;
import com.bfxy.rabbit.producer.broker.RabbitBrokerImpl;
import com.bfxy.rabbit.task.annotation.EnableElasticJob;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * $RabbitProducerAutoConfiguration 自动装配
 */
@EnableElasticJob
@Configuration
@ComponentScan({"com.bfxy.rabbit.producer.*"}) // 最好的做法不是扫描这个包下面的所有类加入容器，而是使用@Bean注解去注入
public class RabbitProducerAutoConfiguration {

//    @Bean
//    public RabbitBroker rabbitBroker() {
//        return new RabbitBrokerImpl();
//    }
//
//    @Bean
//    public ProducerClient producerClient(/*RabbitBroker rabbitBroker*/) {
//        RabbitBroker rabbitBroker = new RabbitBrokerImpl();
//        return new ProducerClient(rabbitBroker);
//    }

}
